package com.java.controller;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.java.service.SugarService;
import com.java.util.resp.BaseRespone;
import com.java.util.resp.TableRespone;

@RestController
@RequestMapping("/admin")
public class SugarController {

	@Autowired private SugarService sugarService;
	
	@PostMapping("/getSugars")
	public TableRespone getSugars(@RequestParam(required = false, defaultValue = "0") int page,
			@RequestParam(required = false, defaultValue = "0") int size) {
		return sugarService.getSugarList(null, page, size);
	}
}
